import request from '@/utils/request'

const api_name = '/edu/chapter'

export default {

    // 章节集合 @GetMapping("/nestedListChapter/{courseId}")
    getNestedTreeList(courseId) {
        return request({
            url: `${api_name}/nestedListChapter/${courseId}`,
            method: 'get'
        })
    },

    save(chapter) {
        return request({
            url: `${api_name}/addChapter`,
            method: 'post',
            data: chapter
        })
    },

    getById(id) {
        return request({
            url: `${api_name}/getChapter/${id}`,
            method: 'get'
        })
    },

    updateById(chapter) {
        return request({
            url: `${api_name}/updateChapter/${chapter.id}`,
            method: 'put',
            data: chapter
        })
    },

    removeById(id) {
        return request({
            url: `${api_name}/deleteChapter/${id}`,
            method: 'delete'
        })
    }

}